<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
</head>
<body>
<div class="report-con">
    <!--    <div class="big-title">报告C报告星耀版</div>-->
    <!--    <div class="desc">报告编号：0000000000000 报告生成时间：2022-01-01 00:00:00 有效期：2022-01-01 00:00:00</div>-->
    <div class="user-info">
        <div class="top">
            <div class="name" id="base_info_name"></div>
            <div class="tip">年龄：<span id="base_info_age"></span></div>
            <div class="tip">性别：<span id="base_info_gender"></span></div>
        </div>
        <div class="row">
            <div class="item"><span>手机号：</span><i id="base_info_phone"></i></div>
            <div class="item"><span>号码归属地：</span><i id="base_info_phone_address"></i></div>
        </div>
        <div class="row">
            <div class="item"><span>身份证号码：</span><i id="base_info_ident_number"></i></div>
            <div class="item"><span>户籍：</span><i id="base_info_ident_number_address"></i></div>
        </div>
    </div>
    <div class="advice-con">
        <div class="advice-title" id="score_norm_explain">风险建议：<span></span></div>
        <div class="advice-list">
            <div class="item level1">极低风险<span>650</span></div>
            <div class="item level2">低风险<span>570</span></div>
            <div class="item level3">中风险<span>530</span></div>
            <div class="item level4">高风险<span>470</span></div>
            <div class="item level5">极高风险<span>430</span><i>0</i></div>
        </div>
    </div>
    <!--    <div class="desc">群体统计逾期率预测：60%</div>-->
    <div class="title">风险标注</div>
    <div class="table">
        <table id="hit_risk_tagging_table">
            <tr>
                <th>风险点</th>
                <th>详解</th>
            </tr>
        </table>
    </div>
    <div class="title">身份信息核验</div>
    <div class="table">
        <table>
            <tr>
                <th>实名核验</th>
                <th>运营商核验</th>
                <th>运营商在网时长</th>
            </tr>
            <tr>
                <td id="ident_info_dict_identity_two_elements"></td>
                <td id="ident_info_dict_network_triple_elements"></td>
                <td id="ident_info_dict_time_online"></td>
            </tr>
        </table>
    </div>
    <div class="title">风险名单</div>
    <div class="table">
        <table>
            <tr>
                <th>信用租赁风险名单</th>
                <th>特殊关注名单</th>
                <th>犯罪通缉名单</th>
                <th>虚拟号码库</th>
            </tr>
            <tr>
                <td id="risk_list_check_credit_rent"></td>
                <td id="risk_list_check_result_xd"></td>
                <td id="risk_list_check_idcard_hit_fztj"></td>
                <td id="risk_list_check_phone_hit_xjhm"></td>
            </tr>
            <tr>
                <th>通信小号库</th>
                <th>归属地位于高风险集中地区</th>
                <th>车辆租赁违约名单</th>
                <th>故意违章乘车名单</th>
            </tr>
            <tr>
                <td id="risk_list_check_phone_hit_txxh"></td>
                <td id="risk_list_check_census_register_high_risk_area"></td>
                <td id="risk_list_check_idcard_hit_clzlwy"></td>
                <td id="risk_list_check_idcard_hit_gywzcc"></td>
            </tr>
        </table>
    </div>
    <div class="title">查询次数</div>
    <div class="table">
        <table>
            <tr>
                <td></td>
                <th>近7天</th>
                <th>近30天</th>
                <th>近90天</th>
            </tr>
            <tr>
                <th>申请查询总数</th>
                <td id="personal_loan_demand_d7_apply_setup_time"></td>
                <td id="personal_loan_demand_m1_apply_setup_time"></td>
                <td id="personal_loan_demand_m3_apply_setup_time"></td>
            </tr>
            <tr>
                <th>一般消费分期平台</th>
                <td id="personal_loan_demand_d7_apply_setup_time_ybxffq"></td>
                <td id="personal_loan_demand_m1_apply_setup_time_ybxffq"></td>
                <td id="personal_loan_demand_m3_apply_setup_time_ybxffq"></td>
            </tr>
            <tr>
                <th>信用卡</th>
                <td id="personal_loan_demand_d7_apply_setup_time_xyk"></td>
                <td id="personal_loan_demand_m1_apply_setup_time_xyk"></td>
                <td id="personal_loan_demand_m3_apply_setup_time_xyk"></td>
            </tr>
            <tr>
                <th>大型消费金融公司</th>
                <td id="personal_loan_demand_d7_apply_setup_time_dxxfjr"></td>
                <td id="personal_loan_demand_m1_apply_setup_time_dxxfjr"></td>
                <td id="personal_loan_demand_m3_apply_setup_time_dxxfjr"></td>
            </tr>
            <tr>
                <th>P2P平台</th>
                <td id="personal_loan_demand_d7_apply_setup_time_p2pwd"></td>
                <td id="personal_loan_demand_m1_apply_setup_time_p2pwd"></td>
                <td id="personal_loan_demand_m3_apply_setup_time_p2pwd"></td>
            </tr>
            <tr>
                <th>小额贷款公司</th>
                <td id="personal_loan_demand_d7_apply_setup_time_xedkgs"></td>
                <td id="personal_loan_demand_m1_apply_setup_time_xedkgs"></td>
                <td id="personal_loan_demand_m3_apply_setup_time_xedkgs"></td>
            </tr>
            <tr>
                <th>其它类型公司</th>
                <td id="personal_loan_demand_d7_apply_setup_time_other"></td>
                <td id="personal_loan_demand_m1_apply_setup_time_other"></td>
                <td id="personal_loan_demand_m3_apply_setup_time_other"></td>
            </tr>
        </table>
    </div>
    <div class="title">历史借贷行为</div>
    <div class="small-title">近12个月申请情况</div>
    <div class="table">
        <table>
            <tr>
                <th>网络贷款类申请机构数</th>
                <th>消费分期类申请机构数</th>
                <th>近12个⽉申请机构总数</th>
            </tr>
            <tr>
                <td id="personal_loan_s_network_loan_apply_mechanis_mnumber"></td>
                <td id="personal_loan_s_consumer_apply_mechanism_number"></td>
                <td id="personal_loan_s_apply_mechanism_number"></td>
            </tr>
        </table>
    </div>
    <div class="table">
        <table>
            <tr>
                <th>近1个月申请次数</th>
                <th>近3个月申请次数</th>
                <th>近6个月申请次数</th>
                <th>近12个月申请次数</th>
                <th>最近一次申请时间</th>
                <th>距离最近一次申请已有 (天)</th>
            </tr>
            <tr>
                <td id="personal_loan_s_apply_time1"></td>
                <td id="personal_loan_s_apply_time3"></td>
                <td id="personal_loan_s_apply_time6"></td>
                <td id="personal_loan_s_apply_time12"></td>
                <td id="personal_loan_s_last_apply_time"></td>
                <td id="personal_loan_s_last_apply_time_distance"></td>
            </tr>
        </table>
    </div>
    <div class="small-title">近24个月放款情况</div>
    <div class="table">
        <table>
            <tr>
                <th>放款机构总数</th>
                <th>分期类放款机构数</th>
                <th>网络贷款类放款机构数</th>
                <th>最近一次放款日期</th>
                <th>距离最近一次放款日期已有(天)</th>
            </tr>
            <tr>
                <td id="personal_loan_f_lenders"></td>
                <td id="personal_loan_f_cflenders"></td>
                <td id="personal_loan_f_nllenders"></td>
                <td id="personal_loan_f_lend_time"></td>
                <td id="personal_loan_f_lend_time_distance"></td>
            </tr>
        </table>
    </div>
    <div class="table">
        <table>
            <tr>
                <td></td>
                <th>近1个月</th>
                <th>近3个月</th>
                <th>近6个月</th>
                <th>近12个月</th>
                <th>近24个月</th>
            </tr>
            <tr>
                <th>放款次数</th>
                <td id="personal_loan_f_lend_number1"></td>
                <td id="personal_loan_f_lend_number3"></td>
                <td id="personal_loan_f_lend_number6"></td>
                <td id="personal_loan_f_lend_number12"></td>
                <td id="personal_loan_f_lend_number24"></td>
            </tr>
            <tr>
                <th>放款金额</th>
                <td id="personal_loan_f_lend_money1"></td>
                <td id="personal_loan_f_lend_money3"></td>
                <td id="personal_loan_f_lend_money6"></td>
                <td id="personal_loan_f_lend_money12"></td>
                <td id="personal_loan_f_lend_money24"></td>
            </tr>
        </table>
    </div>
    <div class="small-title">履约情况</div>
    <div class="table">
        <table>
            <tr>
                <td></td>
                <th>近1个月</th>
                <th>近3个月</th>
                <th>近6个月</th>
                <th>近12个月</th>
                <th>近24个月</th>
            </tr>
            <tr>
                <th>履约次数</th>
                <td id="personal_loan_h_repay_succ1"></td>
                <td id="personal_loan_h_repay_succ3"></td>
                <td id="personal_loan_h_repay_succ6"></td>
                <td id="personal_loan_h_repay_succ12"></td>
                <td id="personal_loan_h_repay_succ24"></td>
            </tr>
            <tr>
                <th>履约金额</th>
                <td id="personal_loan_h_repay_money1"></td>
                <td id="personal_loan_h_repay_money3"></td>
                <td id="personal_loan_h_repay_money6"></td>
                <td id="personal_loan_h_repay_money12"></td>
                <td id="personal_loan_h_repay_money24"></td>
            </tr>
            <tr>
                <th>还款异常次数</th>
                <td id="personal_loan_h_repay_fail1"></td>
                <td id="personal_loan_h_repay_fail3"></td>
                <td id="personal_loan_h_repay_fail6"></td>
                <td id="personal_loan_h_repay_fail12"></td>
                <td id="personal_loan_h_repay_fail24"></td>
            </tr>
        </table>
    </div>
    <div class="title">历史逾期记录</div>
    <div class="table">
        <table>
            <tr>
                <th>近6个月逾期机构总数</th>
                <th>近6个月逾期总次数</th>
                <th>近6个月逾期总金额 (元)</th>
                <th>近6个月逾期未结清次数</th>
            </tr>
            <tr>
                <td id="personal_overdue_history_overdue_mechanism_number"></td>
                <td id="personal_overdue_history_counts"></td>
                <td id="personal_overdue_history_overdue_money"></td>
                <td id="personal_overdue_history_uncleared_counts"></td>
            </tr>
        </table>
    </div>
    <div class="title center">逾期记录详情</div>
    <div class="table">
        <table id="personal_overdue_history">
            <tr>
                <th>序号</th>
                <th>逾期金额区间(元)</th>
                <th>逾期时间</th>
                <th>逾期时长</th>
                <th>是否结清</th>
            </tr>
            <!-- <tr>
              <td>1</td>
                    <td>1</td>
                    <td>1</td>
                    <td>1</td>
                    <td>是</td>
            </tr> -->
        </table>
    </div>
    <div class="desc">说明: S代表期数，1期=7天，S0表示不到7天、S1代表7-14天，以此类推: M代表期数，1期=30天，MO表示不到30天，M1代表30-60天，以此类推。</div>
    <div class="title">租赁行为</div>
    <div class="table">
        <table>
            <tr>
                <td></td>
                <th>近7天</th>
                <th>近1个月</th>
                <th>近3个月</th>
                <th>近6个月</th>
                <th>近12个月</th>
            </tr>
            <tr>
                <th>租赁申请机构数</th>
                <td id="rent_history_d7_apply_agency_time"></td>
                <td id="rent_history_m1_apply_agency_time"></td>
                <td id="rent_history_m3_apply_agency_time"></td>
                <td id="rent_history_m6_apply_agency_time"></td>
                <td id="rent_history_m12_apply_agency_time"></td>
            </tr>
            <tr>
                <th>租赁申请次数</th>
                <td id="rent_history_d7_apply_time"></td>
                <td id="rent_history_m1_apply_time"></td>
                <td id="rent_history_m3_apply_time"></td>
                <td id="rent_history_m6_apply_time"></td>
                <td id="rent_history_m12_apply_time"></td>
            </tr>
        </table>
    </div>
    <div class="title">关联风险监测</div>
    <div class="table">
        <table>
            <tr>
                <th>近3个月身份证关联手机号数</th>
                <th>近3个月手机号关联身份证数</th>
            </tr>
            <tr>
                <td id="relevance_risk_check_m3_idcard_to_phone_time">0</td>
                <td id="relevance_risk_check_m3_phone_to_idcard_time">0</td>
            </tr>
        </table>
    </div>
    <div class="title">法院风险信息</div>
    <div class="table">
        <table id="court_risk_info_list">
            <tr>
                <th>序号</th>
                <th>审结日期</th>
                <th>类型</th>
                <th>摘要说明</th>
                <th>匹配度</th>
                <th>文书详情</th>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
        </table>
    </div>
    <div class="desc">报告使用说明:</div>
    <div class="desc">1、本报告著作权属于本平台，未经许可，不得复制、摘录和转载。</div>
    <div class="desc">2、本报告仅供使用者参考，平台不承担据此报告产生的任何法律责任。</div>
</div>
<script src="/jquery-3.5.1.min.js"></script>
<script src="/url.js"></script>
<script type="text/javascript">
    let url = requestUrl + "/erupt-api/userReport/get";
    let ids = new URLSearchParams(location.href.split('?')[1]).get("ids")
    $.ajax({
        type: "POST",
        url: url,
        headers: {
            token: parent.getAppToken().token
        },
        data: {orderId: ids, type: 1},
        datatype: "json",
        success: function (result) {
            console.log(result)
            if (result.code == 1) {
                dataInputHtml(result.data.infoJson);
            } else {
                alert(result.msg)
            }
        }
    });


    //数据填入
    function dataInputHtml(res) {
        if (res == undefined) {
            return
        }
        let resData = JSON.parse(res)
        // var resData = res.resp_data
        console.log(resData)
        //所有遍历
        for (let key in resData) {
            inputById(resData[key], key)
        }

        //风险建议
        let score_norm_explain = Number(resData.score_norm_explain)
        if (score_norm_explain <= 430) {
            document.getElementById('score_norm_explain').className = 'advice-title level5'
        } else if (score_norm_explain <= 470) {
            document.getElementById('score_norm_explain').className = 'advice-title level4'
        } else if (score_norm_explain <= 530) {
            document.getElementById('score_norm_explain').className = 'advice-title level3'
        } else if (score_norm_explain <= 570) {
            document.getElementById('score_norm_explain').className = 'advice-title level2'
        } else {
            document.getElementById('score_norm_explain').className = 'advice-title level1'
        }
        if (score_norm_explain <= 450) {
            inputById('风险建议：<span>建议拒绝(' + score_norm_explain + ')</span>', 'score_norm_explain')
        } else if (score_norm_explain <= 530) {
            inputById('风险建议：<span>建议审核(' + score_norm_explain + ')</span>', 'score_norm_explain')
        } else if (score_norm_explain <= 650) {
            inputById('风险建议：<span>建议通过(' + score_norm_explain + ')</span>', 'score_norm_explain')
        }
        //基本信息
        for (let key in resData.base_info) {
            inputById(resData.base_info[key], 'base_info_' + key)
        }

        //风险标注
        let hit_risk_tagging = resData.hit_risk_tagging
        let hit_risk_tagging_htmlStr = '<tr>\n' +
            '                <th>风险点</th>\n' +
            '                <th>详解</th>\n' +
            '            </tr>'
        if (hit_risk_tagging && hit_risk_tagging.length > 0) {
            for (let i = 0; i < hit_risk_tagging.length; i++) {
                hit_risk_tagging_htmlStr += `<tr>
                        <td>${hit_risk_tagging[i]}</td>
                        <td></td>
                    </tr>`
            }
            inputById(hit_risk_tagging_htmlStr, 'hit_risk_tagging_table')
        }


        //身份信息核验
        let ident_info_dict = resData.ident_info_dict
        let identity_two_elements = {
            '01': '不一致',
            '02': '一致'
        }
        inputById(identity_two_elements[ident_info_dict.identity_two_elements], 'ident_info_dict_identity_two_elements')
        let network_triple_elements = {
            '01': '不一致',
            '02': '一致'
        }
        inputById(network_triple_elements[ident_info_dict.network_triple_elements], 'ident_info_dict_network_triple_elements')
        let time_online = {
            '1': '[0,3）',
            '2': '[3,6）',
            '3': '[6,12）',
            '4': '[12,24）',
            '5': '[24,+)',
            '0': '查无此号或已注销',
            '-1': '不支持该运营商',
            '999': '手机状态异常（注:1、销号6月以上；2、携号转网；3、未放出去的号码）；非本网手机号码'
        }
        inputById(time_online[ident_info_dict.time_online], 'ident_info_dict_time_online')
        //风险名单检测
        let risk_list_check = resData.risk_list_check
        let checkArr = ['未命中', '命中']
        for (let key in risk_list_check) {
            inputById(checkArr[risk_list_check[key]], 'risk_list_check_' + key)
        }
        //查询总数-近期贷款需求
        let personal_loan_demand = resData.personal_loan_demand
        for (let key in personal_loan_demand) {
            inputById(personal_loan_demand[key], 'personal_loan_demand_' + key)
        }

        //贷款放款信息
        let personal_loan_f = resData.personal_loan_f
        for (let key in personal_loan_f) {
            inputById(personal_loan_f[key], 'personal_loan_f_' + key)
        }

        //贷款申请信息
        let personal_loan_s = resData.personal_loan_s
        // personal_loan_s.other = personal_loan_s.apply_mechanism_number - personal_loan_s.consumer_apply_mechanism_number - personal_loan_s.network_loan_apply_mechanis_mnumber
        for (let key in personal_loan_s) {
            inputById(personal_loan_s[key], 'personal_loan_s_' + key)
        }
        //贷款还款信息
        let personal_loan_h = resData.personal_loan_h
        for (let key in personal_loan_h) {
            inputById(personal_loan_h[key], 'personal_loan_h_' + key)
        }
        //历史逾期记录
        let personal_overdue_history = resData.personal_overdue_history
        for (let key in personal_overdue_history) {
            inputById(personal_overdue_history[key], 'personal_overdue_history_' + key)
        }
        //逾期记录详情
        let personal_overdue_history_datalist = resData.personal_overdue_history.datalist
        let personal_overdue_history_htmlStr = `<tr>
		      <th>序号</th>
		      <th>逾期金额区间(元)</th>
					<th>逾期时间</th>
					<th>逾期时长</th>
					<th>是否结清</th>
		    </tr>`
        let settlement = {
            'N': '否',
            'Y': '是'
        }
        personal_overdue_history_datalist.map((item, index) => {
            personal_overdue_history_htmlStr += `<tr>
						<td>${index}</td>
						<td>${item.amount}</td>
						<td>${item.date}</td>
						<td>${item.count}</td>
						<td>${settlement[item.settlement]}</td>
					<tr>`
        })
        document.getElementById('personal_overdue_history').innerHTML = personal_overdue_history_htmlStr
        //历史逾期记录
        let rent_history = resData.rent_history
        for (let key in rent_history) {
            inputById(rent_history[key], 'rent_history_' + key)
        }
        //关联风险检测
        let relevance_risk_check = resData.relevance_risk_check
        for (let key in relevance_risk_check) {
            inputById(relevance_risk_check[key], 'relevance_risk_check_' + key)
        }
        //法院风险信息
        let court_risk_info_list = resData.court_risk_info_list
        let court_risk_info_list_htmlStr = `<tr>
		      <th>序号</th>
					<th>审结日期</th>
					<th>类型</th>
					<th>摘要说明</th>
					<th>匹配度</th>
					<th>文书详情</th>
		    </tr>`
        let data_type = {
            "cpws": "裁判文书",
            "ktgg": "开庭公告",
            "ajlc": "案件流程信息",
            "fygg": "法院公告",
            "shixin": "失信公告",
            "zxgg": "执行公告",
            "bgt": "曝光台"
        }
        court_risk_info_list.map((item, index) => {
            court_risk_info_list_htmlStr += `<tr>
						<td>${index}</td>
						<td>${item.sort_time_string}</td>
						<td>${data_type[item.data_type]}</td>
						<td>${item.summary}</td>
						<td>${item.compatibility}</td>
						<td></td>
					<tr>`
        })
        document.getElementById('court_risk_info_list').innerHTML = court_risk_info_list_htmlStr
    }

    dataInputHtml()


    function inputById(data, idName) {
        if (document.getElementById(idName)) {
            document.getElementById(idName).innerHTML = data
        }
    }
</script>
</body>
<style type="text/css">
    i {
        font-style: normal;
    }

    .report-con {
        background: #fff;
        color: #000;
        padding-bottom: 20px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .big-title {
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 20px;
    }

    .desc {
        font-size: 12px;
    }

    .title {
        font-size: 20px;
        margin: 28px 0 20px;
    }

    .small-title {
        font-size: 16px;
        margin: 28px 0 20px;
        padding-left: 10px;
        position: relative;
    }

    .small-title::before {
        content: '';
        background: #1972F8;
        width: 2px;
        height: 16px;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
    }

    .user-info {
        margin: 30px 0 20px;
    }

    .user-info .top {
        display: flex;
        align-items: center;
    }

    .user-info .top .name {
        font-size: 16px;
        line-height: 34px;
    }

    .user-info .top .tip {
        border: 1px solid #0938F7;
        height: 28px;
        line-height: 26px;
        padding: 0 10px;
        border-radius: 17px;
        color: #0938F7;
        font-size: 12px;
        margin-left: 10px;
    }

    .user-info .row {
        display: flex;
        align-items: center;
    }

    .user-info .row .item {
        width: 300px;
        font-size: 12px;
        line-height: 30px;
        margin-top: 6px;
    }

    .user-info .row .item span {
        font-weight: bold;
    }

    .advice-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .advice-title span {
        color: red;
        font-weight: bold;
    }

    .advice-title.level1 span {
        color: #42E61A;
    }

    .advice-title.level2 span {
        color: #22DDDD;
    }

    .advice-title.level3 span {
        color: #338FCC;
    }

    .advice-title.level4 span {
        color: #E6941A;
    }

    .advice-title.level5 span {
        color: #E61A42;
    }

    .advice-list {
        display: flex;
        margin-bottom: 30px;
    }

    .advice-list .item {
        flex: 1;
        color: #fff;
        line-height: 26px;
        text-align: center;
        font-size: 12px;
        position: relative;
    }

    .advice-list .item span {
        position: absolute;
        left: 0;
        color: #000;
        top: 100%;
    }

    .advice-list .item i {
        position: absolute;
        right: 0;
        color: #000;
        top: 100%;
    }

    .advice-list .item.level1 {
        background: #42E61A;
    }

    .advice-list .item.level2 {
        background: #22DDDD;
    }

    .advice-list .item.level3 {
        background: #338FCC;
    }

    .advice-list .item.level4 {
        background: #E6941A;
    }

    .advice-list .item.level5 {
        background: #E61A42;
    }

    .table {
        margin-bottom: 20px;
    }

    .table table {
        width: 100%;
        table-layout: fixed;
        font-size: 12px;
        line-height: 36px;
        border-left: 1px solid #D9DAE2;
        border-top: 1px solid #D9DAE2;
        border-collapse: collapse;
    }

    .table table tr th {
        border-right: 1px solid #D9DAE2;
        border-bottom: 1px solid #D9DAE2;
        background: #ECEDF0;
    }

    .table table tr td {
        border-right: 1px solid #D9DAE2;
        border-bottom: 1px solid #D9DAE2;
        text-align: center;
        padding: 0;
    }
</style>
</html>
